QT      += core gui network concurrent
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
#QT      -= gui widgets

defineReplace(remove_extra_config_parameter) {
    configs = $$1
    debug_and_release_params =
    keys = debug Debug release Release debug_and_release
    for (iter, configs) {
        contains(keys, $$iter) {
            debug_and_release_params += $$iter
        }
    }
    for (iter, debug_and_release_params) {
        configs -= $$iter
    }
    configs += $$last(debug_and_release_params)

    return($$configs)
}
CONFIG = $$remove_extra_config_parameter($$CONFIG)

CONFIG(debug, debug|release) {
    FREYALIB_NAME = FreyaLib_d
} else {
    FREYALIB_NAME = FreyaLib
}

unix{
SVNVER = $$system(svn info | grep 'Changed\ Rev' | cut -b 19-)
isEmpty(SVNVER){
SVNVER = $$system(svn info | grep '最后修改的版本' | cut -b 24-)
}
}
win32{
#SVNVER = $$system(for /f \"delims=\" %i in (\'svn info ^| findstr \"Revision\"\') do set rev=%i ^| echo %rev:~10%)
VERSTR = $$system('svn info | findstr "Last\ Changed\ Rev:"')
VERSTR = $$replace(VERSTR, Last , )
VERSTR = $$replace(VERSTR, Changed , )
SVNVER = $$replace(VERSTR, Rev: , )
}
isEmpty(SVNVER){
SVNVER = 0
message("faild to read svn version, use default version:$${SVNVER}")
}
VERSION = 7.0.1.$$SVNVER
DEFINES += FREYAVER=\\\"$$VERSION\\\"

message("$${FREYALIB_NAME} version:$${VERSION}")

FREYALIB_INCLUDEPATH = $$PWD/include \
                        $$PWD/include/abstract \
                        $$PWD/include/base \
                        $$PWD/include/expand \
                        $$PWD/include/external \
                        $$PWD/include/external/ntabwidget

contains(QT, gui) {
message("Now FreyaLib HAS GUI module")
FREYALIB_INCLUDEPATH += $$PWD/include/gui
}else{
message("Now FreyaLib has NO gui module")
}

win32 {
FREYALIB_LIBPATH = $$PWD/../lib
}
unix {
FREYALIB_LIBPATH = $$PWD/../bin
}
